import React from 'react';
import { StyleSheet } from 'react-native';
import { Provider } from 'react-redux';
import { middleware, AppNavigator } from './src/routers'
import AppReducer from './src/reducers';

import { createStore, applyMiddleware } from 'redux';
const store = createStore(AppReducer, applyMiddleware(middleware));

global.actionUtil = (type, payload) => store.dispatch({ type, payload }) //定义全局actions

console.disableYellowBox = true;

export default class App extends React.Component {

  constructor() {
		super();
		this.state = {}
	}
  render() {
		return (
      <Provider store={store}>
        <AppNavigator />
      </Provider>
		)
	}
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
